﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MapEditor.Forms
{
    public partial class NewTileSheetForm : Form
    {
        //Filename for the tilesheet
        public String sheetFileName1;
        public String sheetFileName2;
        public String sheetFileName3;
        public String sheetFileName4;
        public String sheetFileName5;
        public String sheetFileName6;
        public String sheetFileName7;
        public String sheetFileName8;
        public String sheetFileName9;

        //tile Dimensions
        public int tileHeight1 = 32;
        public int tileWidth1 = 32;

        public int tileHeight2 = 32;
        public int tileWidth2 = 32;

        public int tileHeight3 = 32;
        public int tileWidth3 = 32;

        public int tileHeight4 = 32;
        public int tileWidth4 = 32;

        public int tileHeight5 = 32;
        public int tileWidth5 = 32;

        public int tileHeight6 = 32;
        public int tileWidth6 = 32;

        public int tileHeight7 = 32;
        public int tileWidth7 = 32;

        public int tileHeight8 = 32;
        public int tileWidth8 = 32;

        public int tileHeight9 = 32;
        public int tileWidth9 = 32;

        public NewTileSheetForm()
        {
            InitializeComponent();
        }

        private void NewTileSheetForm_Load(object sender, EventArgs e)
        {

        }

        private void browseButton_Click(object sender, EventArgs e)
        {
            openFileDialog1.InitialDirectory = @"C:\";

            openFileDialog1.Title = "Select a Tile File";
            openFileDialog1.FileName = "";

            openFileDialog1.Filter = "Image Files (*.png)| *.png";
            openFileDialog1.FilterIndex = 1;

            //Browse the tilesheet file
            if (openFileDialog1.ShowDialog() != DialogResult.Cancel)
            {
                sheetFileName1 = openFileDialog1.FileName;
            }
            else
            {
                sheetFileName1 = "";
            }

            fileNameTextBox1.Text = sheetFileName1;
        }

        private void okButton_Click(object sender, EventArgs e)
        {
            //Return okay dialog result
            this.DialogResult = DialogResult.OK;
        }

        private void cancelButton_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
        }

        private void browseButton2_Click(object sender, EventArgs e)
        {
            openFileDialog1.InitialDirectory = @"C:\";

            openFileDialog1.Title = "Select a Tile File";
            openFileDialog1.FileName = "";

            openFileDialog1.Filter = "Image Files (*.png)| *.png";
            openFileDialog1.FilterIndex = 1;

            //Browse the tilesheet file
            if (openFileDialog1.ShowDialog() != DialogResult.Cancel)
            {
                sheetFileName2 = openFileDialog1.FileName;
            }
            else
            {
                sheetFileName2 = "";
            }

            fileNameTextBox2.Text = sheetFileName2;
        }

        private void browseButton3_Click(object sender, EventArgs e)
        {
            openFileDialog1.InitialDirectory = @"C:\";

            openFileDialog1.Title = "Select a Tile File";
            openFileDialog1.FileName = "";

            openFileDialog1.Filter = "Image Files (*.png)| *.png";
            openFileDialog1.FilterIndex = 1;

            //Browse the tilesheet file
            if (openFileDialog1.ShowDialog() != DialogResult.Cancel)
            {
                sheetFileName3 = openFileDialog1.FileName;
            }
            else
            {
                sheetFileName3 = "";
            }

            fileNameTextBox3.Text = sheetFileName3;
        }

        private void browseButton4_Click(object sender, EventArgs e)
        {
            openFileDialog1.InitialDirectory = @"C:\";

            openFileDialog1.Title = "Select a Tile File";
            openFileDialog1.FileName = "";

            openFileDialog1.Filter = "Image Files (*.png)| *.png";
            openFileDialog1.FilterIndex = 1;

            //Browse the tilesheet file
            if (openFileDialog1.ShowDialog() != DialogResult.Cancel)
            {
                sheetFileName4 = openFileDialog1.FileName;
            }
            else
            {
                sheetFileName4 = "";
            }

            fileNameTextBox4.Text = sheetFileName4;
        }

        private void browseButton5_Click(object sender, EventArgs e)
        {
            openFileDialog1.InitialDirectory = @"C:\";

            openFileDialog1.Title = "Select a Tile File";
            openFileDialog1.FileName = "";

            openFileDialog1.Filter = "Image Files (*.png)| *.png";
            openFileDialog1.FilterIndex = 1;

            //Browse the tilesheet file
            if (openFileDialog1.ShowDialog() != DialogResult.Cancel)
            {
                sheetFileName5 = openFileDialog1.FileName;
            }
            else
            {
                sheetFileName5 = "";
            }

            fileNameTextBox5.Text = sheetFileName5;
        }

        private void browseButton6_Click(object sender, EventArgs e)
        {
            openFileDialog1.InitialDirectory = @"C:\";

            openFileDialog1.Title = "Select a Tile File";
            openFileDialog1.FileName = "";

            openFileDialog1.Filter = "Image Files (*.png)| *.png";
            openFileDialog1.FilterIndex = 1;

            //Browse the tilesheet file
            if (openFileDialog1.ShowDialog() != DialogResult.Cancel)
            {
                sheetFileName6 = openFileDialog1.FileName;
            }
            else
            {
                sheetFileName6 = "";
            }

            fileNameTextBox6.Text = sheetFileName6;
        }

        private void browseButton7_Click(object sender, EventArgs e)
        {
            openFileDialog1.InitialDirectory = @"C:\";

            openFileDialog1.Title = "Select a Tile File";
            openFileDialog1.FileName = "";

            openFileDialog1.Filter = "Image Files (*.png)| *.png";
            openFileDialog1.FilterIndex = 1;

            //Browse the tilesheet file
            if (openFileDialog1.ShowDialog() != DialogResult.Cancel)
            {
                sheetFileName7 = openFileDialog1.FileName;
            }
            else
            {
                sheetFileName7 = "";
            }

            fileNameTextBox7.Text = sheetFileName7;
        }

        private void browseButton8_Click(object sender, EventArgs e)
        {
            openFileDialog1.InitialDirectory = @"C:\";

            openFileDialog1.Title = "Select a Tile File";
            openFileDialog1.FileName = "";

            openFileDialog1.Filter = "Image Files (*.png)| *.png";
            openFileDialog1.FilterIndex = 1;

            //Browse the tilesheet file
            if (openFileDialog1.ShowDialog() != DialogResult.Cancel)
            {
                sheetFileName8 = openFileDialog1.FileName;
            }
            else
            {
                sheetFileName8 = "";
            }

            fileNameTextBox8.Text = sheetFileName8;
        }

        private void browseButton9_Click(object sender, EventArgs e)
        {
            openFileDialog1.InitialDirectory = @"C:\";

            openFileDialog1.Title = "Select a Tile File";
            openFileDialog1.FileName = "";

            openFileDialog1.Filter = "Image Files (*.png)| *.png";
            openFileDialog1.FilterIndex = 1;

            //Browse the tilesheet file
            if (openFileDialog1.ShowDialog() != DialogResult.Cancel)
            {
                sheetFileName9 = openFileDialog1.FileName;
            }
            else
            {
                sheetFileName9 = "";
            }

            fileNameTextBox9.Text = sheetFileName9;
        }

    }
}
